using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace SystemFunctionLib.SystemEnvironment
{
    /// <summary>
    /// Represents a system hot key.
    /// </summary>
    public class HotKey
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="HotKey"/> by specific name, modifiers, and key.
        /// </summary>
        /// <param name="name">A <see cref="string"/> to identify the system hot key.</param>
        /// <param name="modifiers">Modify keys (Shift, Ctrl, Alt, and/or Windows Logo key).</param>
        /// <param name="key">Key code.</param>
        public HotKey(string name, KeyModifiers modifiers, Keys key)
        {
            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            if (key == Keys.None)
            {
                throw new ArgumentException("key cannot be Keys.None. Must specify a key for the hot key.", "key");
            }

            _name = name;
            _modifiers = modifiers;
            _key = key;
        }

        private int _id = 0;
        /// <summary>
        /// Gets or sets the ID of the hot key.
        /// </summary>
        internal int Id
        {
            get { return _id; }
            set { _id = value; }
        }

        private string _name = null;
        /// <summary>
        /// A <see cref="string"/> used to identify the hot key.
        /// </summary>
        public string Name
        {
            get { return _name; }
        }

        private KeyModifiers _modifiers = KeyModifiers.None;
        /// <summary>
        /// Modifier keys of this hot key.
        /// </summary>
        public KeyModifiers Modifiers
        {
            get { return _modifiers; }
        }

        private Keys _key = Keys.None;
        /// <summary>
        /// Key of this hot key.
        /// </summary>
        public Keys Key
        {
            get { return _key; }
        }
    }
}